<template>
	<!-- 按钮 -->
	<view class="pages">
		<view class="pages-button" :class="{noFixed: !isPosition, isFixed: isPosition}">
			<u-button :custom-style="bottonStyle" @click="submit">{{ name }}</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			//按钮名字
			name: {
				type: String,
				default: '确定'
			},
			isPosition: {
				type: Boolean,
				default: true
			}
		},
		created() {
			
		},
		data() {
			return {
				bottonStyle: {
					backgroundColor: '#11B8A6',
					color: '#fff'
				}
			};
		},
		methods: {
			//点击提交按钮
			submit() {
				this.$emit('submit', true);
			},
		}
	};
</script>

<style lang="scss" scoped>
	.pages {
		width: 100%;
		display: flex;
		justify-content: center;

		.pages-button {
			width: calc(100% - 100rpx);
			z-index: 2;
			&.noFixed{
				padding-bottom: 80rpx;
			}
			&.isFixed{
				position: fixed;
				bottom: 50rpx;
			}
		}
	}
</style>